Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CPR (Curl for People) library for HTTP clients #37

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

aloisklink
Copy link
Contributor

Use the Curl for People (CPR) library instead of cpp-http to make HTTP client requests.

libcpr is a C++ wrapper around the C libcurl library. Compared to cpp-httplib, Curl has much better error checking and error handling, which makes debugging failing HTTP/TLS/SSL issues much easier.

Use C++17 to build brski instead of C++11, so that we can use some
C++17-only libraries, such as `std::filesystem`.
Use the [Curl for People (CPR) library][1] instead of cpp-http to make
HTTP client requests.

libcpr is a C++ wrapper around the C [libcurl][2] library. Compared to
cpp-httplib, Curl has much better error checking and error handling,
which makes debugging failing HTTP/TLS/SSL issues much easier.

[1]: https://docs.libcpr.org/
[2]: https://curl.se/libcurl/
@aloisklink
Copy link
Contributor Author

Looks like the debian CI build is failing due to:

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2666 (message):
  error: could not find git for clone of zlib-populate
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3716 (_ep_add_download_command)
  CMakeLists.txt:23 (ExternalProject_Add)


-- Configuring incomplete, errors occurred!
See also "/build/brski-0.2.0/obj-x86_64-linux-gnu/_deps/zlib-subbuild/CMakeFiles/CMakeOutput.log".

CMake Error at /usr/share/cmake-3.22/Modules/FetchContent.cmake:1075 (message):
  CMake step for zlib failed: 1
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FetchContent.cmake:1216:EVAL:2 (__FetchContent_directPopulate)
  /usr/share/cmake-3.22/Modules/FetchContent.cmake:1216 (cmake_language)
  /usr/share/cmake-3.22/Modules/FetchContent.cmake:1259 (FetchContent_Populate)
  obj-x86_64-linux-gnu/_deps/cpr-src/cmake/zlib_external.cmake:15 (FetchContent_MakeAvailable)
  obj-x86_64-linux-gnu/_deps/cpr-src/CMakeLists.txt:187 (include)

I think we can either:

@aloisklink aloisklink marked this pull request as draft July 4, 2023 10:30
@mereacre mereacre self-requested a review November 27, 2023 22:10
Copy link
Contributor

@mereacre mereacre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mereacre mereacre marked this pull request as ready for review November 27, 2023 22:13
@aloisklink
Copy link
Contributor Author

Now that we've added git, it looks like the error is now an issue to do with cross-compiling for arm64:

CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
   HAVE_POLL_FINE_EXITCODE (advanced)
   HAVE_POLL_FINE_EXITCODE__TRYRUN_OUTPUT (advanced)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants